import React, { PureComponent } from "react";
import PropTypes from "prop-types";
import Item from "../Item";
import "./index.module.css";

export default class List extends PureComponent {

  static propTypes = {
    todoList: PropTypes.array.isRequired,
  };

  render() {
    const { todoList, updateIsState, deleteTodo } = this.props;
    return (
      <ul>
        {todoList.map((item) => {
          return <Item todoObj={item} key={item.id} updateIsState={updateIsState} deleteTodo={deleteTodo}/>;
        })}
      </ul>
    );
  }
}
